home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-02 | 29.6 KB | 651 lines | [TEXT/KAHL] |
- *************************************************
- *************************************************
-
- INSTRUCTIONS FOR SETTING UP AND USING Mac F2C
-
- WITH SYMANTEC C/C++ OR THINK C/C++
-
- *************************************************
- *************************************************
-
-
-
- Before you can use the code produced by Mac F2C, you must set up and build
- all of the required support libraries. There are also special rules that
- must be followed when using code produced by Mac F2C. The process and
- rules are slightly different for Symantec's compilers and for MetroWerk's
- CodeWarrior. These instructions are for setting up Mac F2C for use with
- Symantec C/C++ for PPC and/or THINK C/C++ for 68K. Refer to the
- documentation file "INSTRUCTIONS (CodeWarrior)" for instructions on how to
- set things up for use with MetroWerk CodeWarrior.
-
- USERS UPGRADING FROM VERSION 1.2 or prior: You need to re-install ALL
- libraries and project files, including main.c and f2c.h. There have been
- subtle changes in source code to accomodate Symantec v8 (both PPC code
- generation and changes in THINK libraries and headers in the version of
- THINK that comes with Symantec v8). Major changes are:
-
- (a) Do NOT place the source code to the Mac F2C Libraries in the
- Symantec/THINK Project Manager tree. There are name conflicts
- between the files in libI77/libF77 and some of the new universal
- header files and PPC support files. This means you must build
- the F2C libraries _first_ and then copy the built libraries into
- the Symantec/THINK Project Manager tree.
-
- (b) To accomodate PPC versions, the THINK libraries 'libI77a',
- 'libI77b', and 'libF77' have been renamed 'libI77a 68K',
- 'libI77b 68K', and 'libF77 68K'. You may either modify your
- existing projects or simply rename these libraries to their
- old names after you have built them.
-
- (c) There are two sets of THINK supporting material, one for THINK v7
- sold as such or upgraded from v6 (including THINK v7 with the on-
- line update to v8 translators), and the other for THINK v7 as
- supplied with Symantec C/C++ v8. Please use the latter if (and
- only if) your copy of THINK came off the Symantec v8 package.
-
- The supporting materials are different because the vendor supplied
- libraries are somewhat different between the THINK that comes out
- of a THINK v7 box (or is upgraded to v7 using on-line upgrades)
- and the THINK that comes out of a Symantec v8 box.
-
- All of the THINK project files shipped with Mac F2C are for the THINK
- Project Manger (TPM) version 7. If you are using an earlier version of
- THINK, please refer to the additional instructions in the folder "For THINK
- v6 and Earlier Users".
-
- All of the Symantec project files shipped with Mac F2C are for the Symantec
- Project Manager (SPM) version 8.0.1. They cannot be opened by SPM v8.0.
- If you have v8.0, I (and Symantec) urge you to upgrade to 8.0.1 using the
- free updaters available at major archive sites.
-
-
- The instructions here are broken into four sections:
-
- A. Setting up Mac F2C for...
-
- A1. ...for SPM
-
- A2. ...for TPM v7 (shipped with Symantec v8)
-
- A3. ...for TPM v7 (plain, not shipped with Symantec v8)
-
- B. Verifying correct operation
-
- C. Translating with Mac F2C
-
- D. Using C code produced by Mac F2C
-
-
-
- *****************************************************************************
-
-
- A1. Setting Up Mac F2C for SPM
- *******************************
-
- Follow these instructions to set up Mac F2C for use with the Symantec
- Project Manager (SPM v8) generating PPC native code.
-
-
- Step 1: BRING ALL THE LIBRARIES UP-TO-DATE
-
- The easy way to bring the F2C libraries up to date is to use the provided
- AppleScript. In the folder "SPM Support" is the executable AppleScript
- "Build F2C Libs for SPM". Double-click this file to start the script.
- Follow the directions of the prompts. All required libraries will be
- brought up to date.
-
- If this fails or for any reason you wish to bring them up to date
- manually, simply follow this algorithm:
-
- FOR the project files:
- (1) "libI77 PPC" in the "Mac F2C Libraries" folder
- (2) "libF77 PPC" in the "Mac F2C Libraries" folder
- REPEAT the following steps:
- (a) Double-click on the project file.
- (b) In the Symantec Project Manager's "Build" menu, select the
- "Build Library" command.
- (c) When finished, select the "Remove Objects" command in the
- "Build" menu.
- END FOR-REPEAT
-
-
- Step 2: MOVE THINGS TO THE RECOMMENDED LOCATIONS
-
- For easiest and smoothest operation, the remaining files should be
- installed as follows:
-
- (1) Drag the two static (XCOFF) library files in the folder "Mac F2C
- Libraries" ('libI77 PPC.o' & 'libF77 PPC.o'; the same ones you
- just built in Step 2 above) to the folder that contains
- the SPM. You may put them inside a folder within the SPM folder
- if you so desired. *** WARNING *** Do not place the source code
- for these libraries (found in the folders "libF77 Sources" and
- "libI77 Sources") in the Symantec Project Manager Folder tree. The
- source code for these libraries has name conflicts with Apple's
- Universal Headers (e.g., a file called "fp.h" appears in both but
- the two are NOT equivalent files. Otherwise any of your code that
- #includes any of the conflicted files may inadvertently access the
- wrong file.
-
- (2) The folder "For '(Project Models)'" contains two model project folders
- called "SPM Mac F2C C Project" and "SPM Mac F2C C++ Project". Drag
- both folders to the "(Project Models)" folder located in the same folder
- as the SPM (if you don't plan to use Mac F2C with the C++ compiler,
- you don't need the "SPM Mac F2C C++ Project" folder).
-
-
-
- *****************************************************************************
-
-
- A2. SETTING UP Mac F2C for TPM v7 (shipped with Symantec v8)
- *************************************************************
-
- Follow these instructions if your installation of the THINK Project Manager
- came from the Symantec v8 package. If you have any other version of THINK
- (including any version updated to the v8 level using the free updaters),
- follow the instructions in Section A3. "Setting up Mac F2C for TPM v7
- (plain, not shipped with Symantec v8)"
-
- Step 1: PRELIMINARIES
-
- All the files and folders you need are contained in the folder "For THINK
- v7 shipped with Sym 8" (which is located in the folder "TPM Support" within
- the folder "Symantec/THINK Support"). Unless otherwise indicated, all
- files and folders referred to in the following sections are located in this
- folder. TPM refers to the THINK Project Manager.
-
- (1) The folder "For 'Standard Libraries'" contains four TPM project
- files: "ANSI F2C", "unix F2C", "IOStreams F2C", and "CPlusLib F2C".
- Drag these files (NOT the folder itself) to the "Standard Libraries"
- folder located in the same folder as the TPM application. If you
- don't have the THINK C++ compiler (or you don't plan to use Mac F2C
- with it) you do not need "IOStreams F2C" or "CPlusLib F2C".
-
- (2) The folder "For folder containing TPM" contains two TPM projects
- ("Build 68K PCHs for F2C.π" and "Build Standard 68K PCHs.π") used
- to create customized versions of MacHeaders and MacHeaders++ and to
- then restore the original versions of these. Drag these two files
- (NOT the folder itself) to the folder containing the TPM application.
-
-
- Step 2: BRING ALL THE LIBRARIES UP-TO-DATE
-
- The easy way to bring the F2C libraries up to date is to use the provided
- AppleScript. In the folder "For THINK v7 shipped with Sym 8" is the
- executable AppleScript "Build F2C Libs for TPM". Double-click this file to
- start the script. Follow the directions of the prompts. All required
- libraries will be brought up to date.
-
- If this fails or for any reason you wish to bring them up to date
- manually, simply follow this algorithm:
-
- BUILD CUSTOM PCHs
- Double click on "Build 68K PCHs for F2C.π"
- Precompile "Mac #includes.c" to "MacHeaders" replacing the old one
- Precompile "Mac #includes.cp" to "MacHeaders++" replacing the old one (only for C++)
- End BUILD CUSTOM PCHs
-
- FOR the project files:
- (1) "libI77a 68K" in the "Mac F2C Libraries" folder
- (2) "libI77b 68K" in the "Mac F2C Libraries" folder
- (3) "libF77 68K" in the "Mac F2C Libraries" folder
- (4) "ANSI F2C" in the "Standard Libraries" folder
- (5) "unix F2C" in the "Standard Libraries" folder
- (6) "IOStreams F2C" in the "Standard Libraries" folder (only for C++)
- (7) "CPlusLib F2C" in the "Standard Libraries" folder (only for C++)
- REPEAT the following steps:
- (a) Double-click on the project file.
- (b) In the THINK Project Manager's "Source" menu, select the
- "Make" command.
- (c) Uncheck the "Quick Scan" check-box.
- (d) Click on the "Use Disk" button.
- (e) Click on the "Make" button.
- END FOR-REPEAT
-
- BUILD STANDARD PCHs
- Double click on "Build Standard 68K PCHs.π"
- Precompile "Mac #includes.c" to "MacHeaders" replacing the old one
- Precompile "Mac #includes.cp" to "MacHeaders++" replacing the old one (only for C++)
- End BUILD STANDARD PCHs
-
-
- Step 3: MOVE THINGS TO THE RECOMMENDED LOCATIONS
-
- For easiest and smoothest operation, the remaining files should be
- installed as follows:
-
- (1) Drag the three TPM project files in the folder "Mac F2C Libraries"
- ('libI77a 68K', 'libI77b 68K', & 'libF77 68K'; the same ones you
- brought up-to-date in Step 2 above) to the folder that contains
- the TPM. You may put them inside a folder within the TPM folder
- if you so desired. *** WARNING *** Do not place the source code
- for these libraries (found in the folders "libF77 Sources" and
- "libI77 Sources") in the THINK Project Manager Folder tree. The
- source code for these libraries has name conflicts with Apple's
- Universal Headers (e.g., a file called "fp.h" appears in both but
- the two are NOT equivalent files. Otherwise any of your code that
- #includes any of the conflicted files may inadvertently access the
- wrong file.
-
- (2) The folder "For '(Project Models)'" (located one level up in the
- "TPM Support Folder") contains two model project folders called
- "TPM Mac F2C C Project" and "TPM Mac F2C C++ Project". Drag both
- folders to the "(Project Models)" folder located in the same folder
- as the TPM (if you don't have THINK C++ or don't plan to use Mac F2C
- with the C++ compiler, you don't need the "TPM Mac F2C C++ Project"
- folder).
-
-
-
-
- *****************************************************************************
-
-
-
- A3. SETTING UP Mac F2C for TPM (plain, not shipped with Symantec v8)
- *********************************************************************
-
- Follow these instructions if:
- (a) You have THINK v7 purchased as such (not the version included
- with Symantec v8).
- (b) You upgraded THINK v6 to THINK v7 using the free upgrades.
- (c) You upgraded any version of THINK v7 to THINK "v7+" using the
- free Symantec upgrades that bring you up to the THINK released
- with Symantec v8.
-
- If you have the version of THINK that came with Symantec v8, follow the
- instructions in Section A2. "SETTING UP Mac F2C for TPM v7 (shipped with
- Symantec v8)"
-
- If you have an earlier version of THINK than v7, refer to the documentation
- file "For THINK v6 and Earlier Users".
-
-
- Step 1: PRELIMINARIES
-
- All the files and folders you need are contained in the folder "For plain
- THINK v7" (which is located in the folder "TPM Support" within the folder
- "Symantec/THINK Support"). Unless otherwise indicated, all files and
- folders referred to in the following sections are located in this folder.
- TPM refers to the THINK Project Manager.
-
- (1) The folder "For 'Standard Libraries'" contains four TPM project
- files: "ANSI F2C", "unix F2C", "IOStreams F2C", and "CPlusLib F2C".
- Drag these files (NOT the folder itself) to the "Standard Libraries"
- folder located in the same folder as the TPM application. If you
- don't have the THINK C++ compiler (or you don't plan to use Mac F2C
- with it) you do not need "IOStreams F2C" or "CPlusLib F2C".
-
- (2) You need to fix a bug in one of the header files supplied with THINK.
- In the folder Standard Libraries, you will find the file "fltpnt.h".
- Open it and comment out or delete the following two lines:
-
- typedef float float_t;
- typedef double double_t;
-
- These lines are not only unnecessary, but actually wrong when doubles
- are 8-bytes long. Notice that "fltpnt.h" includes the file "SANE.h"
- which in turn includes "Types.h". "Types.h" contains the correct
- definitions of float_t and double_t. Thus, the above two lines can be
- safely deleted. Symantec has incorporate this fix in the version of
- "fltpnt.h" supplied with Symantec C/C++ v8.
-
-
- Step 2: BRING ALL THE LIBRARIES UP-TO-DATE
-
- The easy way to bring the F2C libraries up to date is to use the provided
- AppleScript. In the folder "For plain THINK v7 " is the executable
- AppleScript "Build F2C Libs for THINK". Double-click this file to start
- the script. Follow the directions of the prompts. All required libraries
- will be brought up to date.
-
- If this fails or for any reason you wish to bring them up to date
- manually, simply follow this algorithm:
-
- FOR the project files:
- (1) "libI77a 68K" in the "Mac F2C Libraries" folder
- (2) "libI77b 68K" in the "Mac F2C Libraries" folder
- (3) "libF77 68K" in the "Mac F2C Libraries" folder
- (4) "ANSI F2C" in the "Standard Libraries" folder
- (5) "unix F2C" in the "Standard Libraries" folder
- (6) "IOStreams F2C" in the "Standard Libraries" folder (only for C++)
- (7) "CPlusLib F2C" in the "Standard Libraries" folder (only for C++)
- REPEAT the following steps:
- (a) Double-click on the project file.
- (b) In the THINK Project Manager's "Source" menu, select the
- "Make" command.
- (c) Uncheck the "Quick Scan" check-box.
- (d) Click on the "Use Disk" button.
- (e) Click on the "Make" button.
- END FOR-REPEAT
-
-
- Step 3: MOVE THINGS TO THE RECOMMENDED LOCATIONS
-
- For easiest and smoothest operation, the remaining files should be
- installed as follows:
-
- (1) Drag the three TPM project files in the folder "Mac F2C Libraries"
- ('libI77a 68K', 'libI77b 68K', & 'libF77 68K'; the same ones you
- brought up-to-date in Step 2 above) to the folder that contains
- the TPM. You may put them inside a folder within the TPM folder
- if you so desired. *** WARNING *** Do not place the source code
- for these libraries (found in the folders "libF77 Sources" and
- "libI77 Sources") in the THINK Project Manager Folder tree. The
- source code for these libraries has name conflicts with Apple's
- Universal Headers (e.g., a file called "fp.h" appears in both but
- the two are NOT equivalent files. Otherwise any of your code that
- #includes any of the conflicted files may inadvertently access the
- wrong file.
-
- (2) The folder "For '(Project Models)'" (located one level up in the
- "TPM Support Folder") contains two model project folders called
- "TPM Mac F2C C Project" and "TPM Mac F2C C++ Project". Drag both
- folders to the "(Project Models)" folder located in the same folder
- as the TPM (if you don't have THINK C++ or don't plan to use Mac F2C
- with the C++ compiler, you don't need the "TPM Mac F2C C++ Project"
- folder).
-
-
-
-
- *****************************************************************************
-
-
- B. VERIFYING CORRECT OPERATION OF Mac F2C
- ******************************************
-
- The folder "Test Project ƒ" contains the following files:
-
- (1) "test.f" -- a sample FORTRAN program.
-
- (2) "main.c" -- the main program required to run programs produced
- by Mac F2C, suffixed to compile with C.
-
- (3) "main.cp" -- the main program required to run programs produced
- by Mac F2C, suffixed to compile with C++.
-
- (4) "f2c.h" -- an include file required to compile programs produced
- by Mac F2C.
-
- (5) "test.c (C Output)" -- what you should get when you translate
- the sample FORTRAN code files.
-
- (6) "Test.68K.π" -- a TPM v7.0.4 project to run the sample C program.
-
- (7) "Test.PPC.π" -- an SPM v8.0 project to run the sample C program.
-
- (8) "test.c (C++ Output)" -- what you should get when you translate
- the sample FORTRAN code files and select the C++ output option.
-
- (9) "Test++.68K.π" -- a TPM v7.0.4 project to run the sample C++ program.
-
- (10) "Test++.PPC.π" -- an SPM v8.0 project to run the sample C++ program.
-
- (11) "Test.*.µ" -- various CodeWarrior project files (not used)
-
- Translate the sample FORTRAN program "Test.f" simply by dragging it onto
- Mac F2C. Do not change any of the options (use "Factory Defaults"). Once
- you have done this you can compare it with "Test.c (C Output)" to verify
- that you got the same thing. If so, double click on the TPM or SPM project
- file ("Test.68K.π" or "Test.PPC.π") and run it to verify correct operation.
-
- If you also plan to use Mac F2C with the C++ compiler, you can run a second
- test to verify correct operation with the C++ compiler. Start Mac F2C and
- in the "C Options" dialog, select "C++ code". Do not change any of the
- other options. Translate "Test.f". Compare it with "Test.cp (C++ Output)"
- to verify that you got the same thing. If so, double click on the TPM or
- SPM project file ("Test++.68K.π" or "Test++.PPC.π") and run it to verify
- correct operation.
-
-
-
-
-
- *****************************************************************************
-
-
- C. TRANSLATING FORTRAN PROGRAMS
- ********************************
-
- You can use Mac F2C to translate FORTRAN to C using three methods:
-
- (a) Start up Mac F2C and select the "Translate" command in the File menu.
-
- (b) Drag-&-drop a bunch of FORTRAN files onto Mac F2C.
-
- (c) Use a scripting language (e.g., AppleScript) to send Mac F2C either an
- 'open' command, an 'f2c' command, or a 'translate' command. For more
- information on driving Mac F2C from a script see the instructions in
- the folder "Mac F2C AppleEvents".
-
- FORTRAN files must be TEXT files and *must* end in ".f" or ".F" (sorry, but
- the ending is determined by the unix f2c kernel -- it rejects files handed
- to it with any other endings). The output file is the same name with a
- ".c" extension if you selected C code for the output, or the same name with
- a ".cp" extension if you selected C++ code for the output.
-
- The first five items in the Options menu let you control the various
- translation and code generation options. If you check the "Make these the
- new defaults" box before clicking the "OK" button, your option selections
- will be saved in a Preference file and used again the next time you start
- Mac F2C.
-
- If you do not understand what an option means, check the balloon help. The
- help balloons provide more detailed explanations of what each option means.
- They also explain why dimmed options are not available and what you can do
- to make them available.
-
- The last item in the Options menu ("Mac F2C Preferences…") lets you control
- how Mac F2C operates. This dialog lets you control:
-
- - How Mac F2C behaves after having been launched with a drag-&-drop.
-
- - Whether the "Advanced Options" dialog will have an edit text field
- that allows you to enter unix option switches directly.
-
- - The creator type for all of the output files (determines their icon).
-
- - Whether and how Mac F2C interacts with THINK and/or CodeWarrior. If
- the notify option is checked, Mac F2C will attempt to touch the
- corresponding THINK or CodeWarrior project file after translating a
- FORTRAN file into C successfully. If THINK/CodeWarrior is not running
- or if the file is not part of the current project, Mac F2C will fail
- silently. If the make option is checked, then Mac F2C will also send
- a make (e.g., bring up to date) command to THINK/CodeWarrior. If a
- group of FORTRAN files are translated at once (via a drag-&-drop or
- via an AppleScript), the make command is not sent until the last file
- is translated. Again, Mac F2C fails silently if THINK or CodeWarrior
- can't do it.
-
- Version 1.2.1 does *not* interact with the Symantec Project Manager.
- This deficiency will be corrected in a future version of Mac F2C.
-
- As in the case of the other option dialogs, check the balloon help if you
- do not understand what an option means.
-
-
-
-
- *****************************************************************************
-
-
- D. USING C CODE PRODUCED BY MAC F2C
- ************************************
-
- Part 1. Generating 68K code using THINK C/C++
- ++++++++++++++++++++++++++++++++++++++++++++++
-
- The C code produced by Mac F2C has the following compile and link
- requirements for generating 68K code using THINK C/C++:
-
- - the header file "f2c.h"
- - the F2C libraries "libI77a 68K", "libI77b 68K", and "libF77 68K"
- - the C libraries "ANSI F2C" and "unix F2C"
- - the C++ libraries "IOStreams F2C" and "CPlusLib F2C" (C++ only)
- - 4-byte integers (C only)
- - 8-byte doubles
- - native floating-point format
- - far code
- - far data
- - C++ ANSI conformance UNCHECKED (C++ only)
-
- In addition, if you compile a stand-alone FORTRAN program (instead of only
- some FORTRAN subroutines) you must include "main.c" in your project (or
- "main.cp" if you use C++; the two files are identical). This is because
- the original main routine in the FORTRAN program becomes a function that is
- called by main.c. In addition, main.c performs a series of initializations
- (primarily related to error catching) prior to executing the main FORTRAN
- program.
-
- The model project provided ("TPM Mac F2C C Project") is a folder that
- contains everything you need to compile and run code produced by Mac F2C
- using the C compiler. This folder has a copy of main.c, f2c.h, and a
- project file that includes the appropriate libraries and option settings.
-
- The C++ model project ("TPM Mac F2C C++ Project") is a folder that contains
- everything you need to compile and run code produced by Mac F2C using the
- C++ compiler. This folder has a copy of main.cp, f2c.h, and a project file
- that includes the appropriate libraries and option settings.
-
- If you have THINK C version 7.0 or better, simply create a new project by
- using the "New Project" command in the THINK Project Manager's "File" menu
- and selecting "TPM Mac F2C C Project" or "TPM Mac F2C C++ Project" as the
- model for the new project. Add your code files as appropriate, bring it
- up-to-date (you may need to use the "Make" command and the "Use Disk"
- option the first time), and run.
-
- If you have an earlier version of THINK C, first replace the project file
- provided in "Mac F2C C Project" with one made with your version of THINK (I
- have included a list of the project contents for your convenience -- see
- the additional instructions in the file "For THINK v6 and Earlier Users" if
- you have trouble doing this). Do not include any objects at this time. To
- start a new project, duplicate the entire "Mac F2C C Project" folder,
- change the names of files and folders as appropriate, add your code files,
- and bring everything up-to-date.
-
- If you compile a FORTRAN subroutine or function that you want to call from
- a C program, look at the C code produced by Mac F2C to see the appropriate
- calling protocol. You may or may not need to include the F2C support
- libraries ("libF77 68K", "libI77a 68K", and "libI77b 68K"). In rare cases,
- you may also need to copy some of the initialization code from "main.c" to
- your calling program.
-
- As noted above, code produced by Mac F2C *MUST* be compiled with 4-byte
- integers. This requirement cannot be relaxed. The other requirements
- (8-byte doubles, native floating-point format, far data, and far code) can
- sometimes be relaxed:
-
- - IF you do not use doubles/reals in any situation where their size
- relative to integers matters (e.g., if you do not use doubles/reals
- in equivalence and common statements), then your code probably does
- not require 8-byte doubles. You need to verify this on a case-
- by-case basis.
-
- This requirement exists because Mac F2C follows FORTRAN sizing
- rules when compiling FORTRAN code: sizeof(real) == sizeof(integer)
- and sizeof(double) == 2*sizeof(real). FORTRAN real is compiled as
- C float and FORTRAN double as C double, so doubles have to be
- 8-bytes long for equivalence and common statements to be properly
- aligned. There are a few other cases where the size of double
- variables matters; see AT&T Computing Science Technical Report
- No. 149 (included with Mac F2C) for a detailed discussion.
-
- - IF you compile your program with the option "Local variables are
- automatic" and you do not have large static data structures, you
- *might* not need "Far Data". You need to verify this on a case-
- by-case basis.
-
- Mac F2C creates large static data structures for I/O. If you create
- local variables in the global area (static instead of automatic) or
- if you have other static data, you will almost certainly require
- "Far Data". The I/O data structures can be large enough that you may
- require "Far Data" for that reason alone.
-
- - IF your program is not very large and doesn't have a large number of
- subroutines, you probably will not need "Far Code". You need to verify
- this on a case-by-case basis.
-
- Mac F2C tends to produced redundant copies of utility code (especially
- code for performing array indexing). It can also produce large numbers
- of auxiliary functions. The result is that "Far Code" is often
- required. Compile first with "Far Code", then check the code size and
- jump table to see if you can relax this requirement.
-
- - IF your program will NOT be compiled under THINK C++ (i.e., you chose
- K&R C or ANSI C output instead of C++ output) and you will not link
- with code produced by THINK C++, you do not need native floating-point
- format. The native floating-point format option is selected only to
- guarantee compatibility with the THINK C++ compiler should you chose to
- use the output of Mac F2C with C++ code.
-
- If you change the "8-byte doubles", "native floating-point format", "Far
- Code", or "Far Data" options, remember to also change them in all the
- libraries, specifically "libI77a 68K", "libI77b 68K", "libF77 68K", "ANSI
- F2C", "unix F2C", "IOStreams F2C", and "CPlusLib F2C" (the latter two for
- C++ only)
-
- I urge all users to read the enclosed AT&T Computing Science Technical
- Report No. 149. Consider it your compiler and language reference
- manual. You can print the report by downloading it to any PostScript
- printer. You can use Apple's LaserWriter Utility application to do
- this or you can use any of the many equivalent utilities.
-
-
-
- Part II. Generating PPC code using Symantec C/C++
- ++++++++++++++++++++++++++++++++++++++++++++++++++
-
- The C code produced by Mac F2C has the following compile and link
- requirements for generating PPC code using Symantec C/C++:
-
- - the header file "f2c.h"
- - the F2C libraries "libI77 PPC.o" and "libF77 PPC.o"
- - the Mac libraries "InterfaceLib.xcoff" and "MathLib.xcoff"
- - the C libraries "PPCANSI.o", "PPCunix.0", and "PPCRuntime.0"
- - the C++ libraries "PPCIOStreams.o" and "PPCCPlusLib.o" (C++ only)
- - C++ ANSI conformance UNCHECKED (C++ only)
-
- In addition, if you compile a stand-alone FORTRAN program (instead of only
- some FORTRAN subroutines) you must include "main.c" in your project (or
- "main.cp" if you use C++; the two files are identical). This is because
- the original main routine in the FORTRAN program becomes a function that is
- called by main.c. In addition, main.c performs a series of initializations
- (primarily related to error catching) prior to executing the main FORTRAN
- program.
-
- The model project provided ("SPM Mac F2C C Project") is a folder that
- contains everything you need to compile and run code produced by Mac F2C
- using the C compiler. This folder has a copy of main.c, f2c.h, and a
- project file that includes the appropriate libraries and option settings.
-
- The C++ model project ("SPM Mac F2C C++ Project") is a folder that contains
- everything you need to compile and run code produced by Mac F2C using the
- C++ compiler. This folder has a copy of main.cp, f2c.h, and a project file
- that includes the appropriate libraries and option settings.
-
- Create a new project by using the "New Project" command in the Symantec
- Project Manager's "File" menu and selecting "SPM Mac F2C C Project" or "SPM
- Mac F2C C++ Project" as the model for the new project. Add your code files
- as appropriate, bring it up-to-date (you may need to use the "Make" command
- and the "Use Disk" option the first time), and run.
-
- If you compile a FORTRAN subroutine or function that you want to call from
- a C program, look at the C code produced by Mac F2C to see the appropriate
- calling protocol. You may or may not need to include the F2C support
- libraries ("libF77 PPC.o" and "libI77 PPC.o"). In rare cases, you may also
- need to copy some of the initialization code from "main.c" to your calling
- program.
-
- I urge all users to read the enclosed AT&T Computing Science Technical
- Report No. 149. Consider it your compiler and language reference
- manual. You can print the report by downloading it to any PostScript
- printer. You can use Apple's LaserWriter Utility application to do
- this or you can use any of the many equivalent utilities.
-
-
-
-